package day07;

import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.SimpleTagSupport;
import java.io.IOException;


//<xxx:msg info="Hello" num="3"></xxx:msg>
public class MsgTag extends SimpleTagSupport {

    private String info;
    private int num;

    @Override
    public void doTag() throws IOException {

        PageContext pageContext= (PageContext) getJspContext();

        JspWriter out=pageContext.getOut();

        for (int i = 0; i < num; i++) {
            out.print(info+"<br/>");

        }

    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }
}
